﻿using System.Collections.Generic;
using csvm.recordbuilder.contract;
using csvm.datamodel.contract;
using System.Linq;


namespace csvm.recordbuilder
{
    public class RecordBuilder : IRecordBuilder
    {
        private static IEnumerable<string> SplitLineIntoColumns(string line)
        {
            return line.Split(';' );
        }


        public IEnumerable<Record> BuildRecords(IEnumerable<string> lines)
        {
            return lines.Select(line => new Record(SplitLineIntoColumns(line)));
        }
    }
}


/*
            foreach( var line in lines )
            {
                yield return new Record(SplitLineIntoColumns(line));
            }

*/